<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/pwm.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__pwm_2include_2hardware_2pwm_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">pwm.h</div></div>
</div><!--header-->
<div class="contents">
<a href="rp2__common_2hardware__pwm_2include_2hardware_2pwm_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_PWM_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_PWM_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;hardware/structs/pwm.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &quot;hardware/regs/dreq.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &quot;hardware/regs/intctrl.h&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_PWM, Enable/disable assertions in the hardware_pwm module, type=bool, default=0, group=hardware_pwm</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_PWM</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_PWM </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_PWM PARAM_ASSERTIONS_ENABLED_PWM</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_PWM 0</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga0a00197703c8606641488cfff3f660e6">   54</a></span><span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pwm.html#ga0a00197703c8606641488cfff3f660e6">pwm_clkdiv_mode</a></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>{</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">   56</a></span>    <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">PWM_DIV_FREE_RUNNING</a> = 0, </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7">   57</a></span>    <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7">PWM_DIV_B_HIGH</a> = 1,       </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40">   58</a></span>    <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40">PWM_DIV_B_RISING</a> = 2,     </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012">PWM_DIV_B_FALLING</a> = 3     </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012">   60</a></span>};</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="keyword">enum</span> pwm_chan</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>{</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    PWM_CHAN_A = 0,</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>    PWM_CHAN_B = 1</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>};</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="structpwm__config.html">   68</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    uint32_t csr;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    uint32_t div;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>    uint32_t top;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>} <a class="code hl_struct" href="structpwm__config.html">pwm_config</a>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span><span class="preprocessor">#ifndef PWM_DREQ_NUM</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a1504bdb2bd8aaa535903ea11aa2c2994">DREQ_PWM_WRAP1</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a2a861c9dcce9e158ace7bc5d547ebde1">DREQ_PWM_WRAP0</a> + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014adafe5a7f2f401a496e842c7a2c95dac5">DREQ_PWM_WRAP7</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a2a861c9dcce9e158ace7bc5d547ebde1">DREQ_PWM_WRAP0</a> + 7, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gab346f319fab9342c66d48bdcc9bb7430">   85</a></span><span class="preprocessor">#define PWM_DREQ_NUM(slice_num) (DREQ_PWM_WRAP0 + (slice_num))</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><span class="preprocessor">#ifndef PWM_GPIO_SLICE_NUM</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gad7c4554b59132ddd4a9773cca4a27203">   95</a></span><span class="preprocessor">#define PWM_GPIO_SLICE_NUM(gpio) ({             \</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span><span class="preprocessor">    uint slice_num;                             \</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span><span class="preprocessor">    if ((gpio) &lt; 32) {                          \</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="preprocessor">        slice_num = ((gpio) &gt;&gt; 1u) &amp; 7u;        \</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="preprocessor">    } else {                                    \</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="preprocessor">        slice_num = 8u + (((gpio) &gt;&gt; 1u) &amp; 3u); \</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span><span class="preprocessor">    }                                           \</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span><span class="preprocessor">    slice_num;                                  \</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="preprocessor">})</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_slice_num_param(__unused uint slice_num) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>    valid_params_if(HARDWARE_PWM, slice_num &lt; NUM_PWM_SLICES);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>}</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga8b2117d67a544f64c001f4f32c723eef">  115</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pwm.html#ga8b2117d67a544f64c001f4f32c723eef">pwm_gpio_to_slice_num</a>(uint gpio) {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    valid_params_if(HARDWARE_PWM, gpio &lt; NUM_BANK0_GPIOS);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pwm.html#gad7c4554b59132ddd4a9773cca4a27203">PWM_GPIO_SLICE_NUM</a>(gpio);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>}</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga96ba504fe00cb8e0d88f0730cdfdaafc">  127</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pwm.html#ga96ba504fe00cb8e0d88f0730cdfdaafc">pwm_gpio_to_channel</a>(uint gpio) {</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>    valid_params_if(HARDWARE_PWM, gpio &lt; NUM_BANK0_GPIOS);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>    <span class="keywordflow">return</span> gpio &amp; 1u;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>}</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span> </div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga031fe8a502c9640ed4f5fab74d6248ae">  141</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga031fe8a502c9640ed4f5fab74d6248ae">pwm_config_set_phase_correct</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, <span class="keywordtype">bool</span> phase_correct) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    c-&gt;csr = (c-&gt;csr &amp; ~PWM_CH0_CSR_PH_CORRECT_BITS)</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        | (bool_to_bit(phase_correct) &lt;&lt; PWM_CH0_CSR_PH_CORRECT_LSB);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>}</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga679802450ac829eff368e8f109df387e">  156</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga679802450ac829eff368e8f109df387e">pwm_config_set_clkdiv</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, <span class="keywordtype">float</span> div) {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>    valid_params_if(HARDWARE_PWM, div &gt;= 1.f &amp;&amp; div &lt; 256.f);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>    c-&gt;div = (uint32_t)(div * (<span class="keywordtype">float</span>)(1u &lt;&lt; PWM_CH0_DIV_INT_LSB));</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>}</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga3b0d7a6e493b4dc9ded8f53fb9be474c">  172</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga3b0d7a6e493b4dc9ded8f53fb9be474c">pwm_config_set_clkdiv_int_frac</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, uint8_t integer, uint8_t fract) {</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>    valid_params_if(HARDWARE_PWM, integer &gt;= 1);</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>    valid_params_if(HARDWARE_PWM, fract &lt; 16);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>    c-&gt;div = (((uint)integer) &lt;&lt; PWM_CH0_DIV_INT_LSB) | (((uint)fract) &lt;&lt; PWM_CH0_DIV_FRAC_LSB);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>}</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga1d60d45df884a7abbde52e326586d55a">  188</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga1d60d45df884a7abbde52e326586d55a">pwm_config_set_clkdiv_int</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, uint div) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>    valid_params_if(HARDWARE_PWM, div &gt;= 1 &amp;&amp; div &lt; 256);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga3b0d7a6e493b4dc9ded8f53fb9be474c">pwm_config_set_clkdiv_int_frac</a>(c, (uint8_t)div, 0);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>}</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga27a86a921b2ad2ebd811db1255d34d06">  203</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga27a86a921b2ad2ebd811db1255d34d06">pwm_config_set_clkdiv_mode</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pwm.html#ga0a00197703c8606641488cfff3f660e6">pwm_clkdiv_mode</a> mode) {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>    valid_params_if(HARDWARE_PWM, mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">PWM_DIV_FREE_RUNNING</a> ||</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>            mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40">PWM_DIV_B_RISING</a> ||</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>            mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7">PWM_DIV_B_HIGH</a> ||</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>            mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012">PWM_DIV_B_FALLING</a>);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span>    c-&gt;csr = (c-&gt;csr &amp; ~PWM_CH0_CSR_DIVMODE_BITS)</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span>        | (((uint)mode) &lt;&lt; PWM_CH0_CSR_DIVMODE_LSB);</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>}</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span> </div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gab459185e217d5e215dae3cfb3d6de1b5">  219</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gab459185e217d5e215dae3cfb3d6de1b5">pwm_config_set_output_polarity</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, <span class="keywordtype">bool</span> a, <span class="keywordtype">bool</span> b) {</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>    c-&gt;csr = (c-&gt;csr &amp; ~(PWM_CH0_CSR_A_INV_BITS | PWM_CH0_CSR_B_INV_BITS))</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>        | ((bool_to_bit(a) &lt;&lt; PWM_CH0_CSR_A_INV_LSB) | (bool_to_bit(b) &lt;&lt; PWM_CH0_CSR_B_INV_LSB));</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>}</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span> </div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gad6cf6d9237144234732a50eb6d5e4fe9">  232</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gad6cf6d9237144234732a50eb6d5e4fe9">pwm_config_set_wrap</a>(<a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, uint16_t wrap) {</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>    c-&gt;top = wrap;</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>}</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span> </div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga01d3e90bb7aa9a8b6884eddbfbebc175">  247</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga01d3e90bb7aa9a8b6884eddbfbebc175">pwm_init</a>(uint slice_num, <a class="code hl_struct" href="structpwm__config.html">pwm_config</a> *c, <span class="keywordtype">bool</span> start) {</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>    pwm_hw-&gt;slice[slice_num].csr = 0;</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>    pwm_hw-&gt;slice[slice_num].ctr = PWM_CH0_CTR_RESET;</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>    pwm_hw-&gt;slice[slice_num].cc = PWM_CH0_CC_RESET;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>    pwm_hw-&gt;slice[slice_num].top = c-&gt;top;</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>    pwm_hw-&gt;slice[slice_num].div = c-&gt;div;</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>    pwm_hw-&gt;slice[slice_num].csr = c-&gt;csr | (bool_to_bit(start) &lt;&lt; PWM_CH0_CSR_EN_LSB);</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>}</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span> </div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gad76f94a6dd6133c52284b6be8ae98e16">  266</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_struct" href="structpwm__config.html">pwm_config</a> <a class="code hl_function" href="group__hardware__pwm.html#gad76f94a6dd6133c52284b6be8ae98e16">pwm_get_default_config</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span>    <a class="code hl_struct" href="structpwm__config.html">pwm_config</a> c = {0, 0, 0};</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga031fe8a502c9640ed4f5fab74d6248ae">pwm_config_set_phase_correct</a>(&amp;c, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga1d60d45df884a7abbde52e326586d55a">pwm_config_set_clkdiv_int</a>(&amp;c, 1);</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga27a86a921b2ad2ebd811db1255d34d06">pwm_config_set_clkdiv_mode</a>(&amp;c, <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">PWM_DIV_FREE_RUNNING</a>);</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>    <a class="code hl_function" href="group__hardware__pwm.html#gab459185e217d5e215dae3cfb3d6de1b5">pwm_config_set_output_polarity</a>(&amp;c, <span class="keyword">false</span>, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>    <a class="code hl_function" href="group__hardware__pwm.html#gad6cf6d9237144234732a50eb6d5e4fe9">pwm_config_set_wrap</a>(&amp;c, 0xffffu);</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>    <span class="keywordflow">return</span> c;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>}</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span> </div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga6f8fe346e6912cfab3d36b00043a3627">  291</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga6f8fe346e6912cfab3d36b00043a3627">pwm_set_wrap</a>(uint slice_num, uint16_t wrap) {</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>    pwm_hw-&gt;slice[slice_num].top = wrap;</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>}</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span> </div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga18a2b3bbc240d1a9b36526d69c06ec3d">  311</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga18a2b3bbc240d1a9b36526d69c06ec3d">pwm_set_chan_level</a>(uint slice_num, uint chan, uint16_t level) {</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>        &amp;pwm_hw-&gt;slice[slice_num].cc,</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>        ((uint)level) &lt;&lt; (chan ? PWM_CH0_CC_B_LSB : PWM_CH0_CC_A_LSB),</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>        chan ? PWM_CH0_CC_B_BITS : PWM_CH0_CC_A_BITS</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>    );</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>}</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span> </div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gae7064c88717eee935e50138f5b0ae2b7">  335</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gae7064c88717eee935e50138f5b0ae2b7">pwm_set_both_levels</a>(uint slice_num, uint16_t level_a, uint16_t level_b) {</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span>    pwm_hw-&gt;slice[slice_num].cc = (((uint)level_b) &lt;&lt; PWM_CH0_CC_B_LSB) | (((uint)level_a) &lt;&lt; PWM_CH0_CC_A_LSB);</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno">  338</span>}</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno">  339</span> </div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga279d1ba7dcc8f19619f389317efb41fd">  358</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga279d1ba7dcc8f19619f389317efb41fd">pwm_set_gpio_level</a>(uint gpio, uint16_t level) {</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span>    valid_params_if(HARDWARE_PWM, gpio &lt; NUM_BANK0_GPIOS);</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno">  360</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga18a2b3bbc240d1a9b36526d69c06ec3d">pwm_set_chan_level</a>(<a class="code hl_function" href="group__hardware__pwm.html#ga8b2117d67a544f64c001f4f32c723eef">pwm_gpio_to_slice_num</a>(gpio), <a class="code hl_function" href="group__hardware__pwm.html#ga96ba504fe00cb8e0d88f0730cdfdaafc">pwm_gpio_to_channel</a>(gpio), level);</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>}</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span> </div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga157c8b11483967714823187725a5ed5a">  371</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint16_t <a class="code hl_function" href="group__hardware__pwm.html#ga157c8b11483967714823187725a5ed5a">pwm_get_counter</a>(uint slice_num) {</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span>    <span class="keywordflow">return</span> (uint16_t)(pwm_hw-&gt;slice[slice_num].ctr);</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span>}</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno">  375</span> </div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga5179ec971146ab611b9232587e945769">  385</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga5179ec971146ab611b9232587e945769">pwm_set_counter</a>(uint slice_num, uint16_t c) {</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span>    pwm_hw-&gt;slice[slice_num].ctr = c;</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno">  388</span>}</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno">  389</span> </div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga98a47b25fcc2f28addf0a28ee3234efd">  399</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga98a47b25fcc2f28addf0a28ee3234efd">pwm_advance_count</a>(uint slice_num) {</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno">  401</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, PWM_CH0_CSR_PH_ADV_BITS);</div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno">  402</span>    <span class="keywordflow">while</span> (pwm_hw-&gt;slice[slice_num].csr &amp; PWM_CH0_CSR_PH_ADV_BITS) {</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno">  403</span>        <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno">  404</span>    }</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno">  405</span>}</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span> </div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga0dec65009d8c0738677818b680fd2ad9">  416</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga0dec65009d8c0738677818b680fd2ad9">pwm_retard_count</a>(uint slice_num) {</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno">  417</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno">  418</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, PWM_CH0_CSR_PH_RET_BITS);</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno">  419</span>    <span class="keywordflow">while</span> (pwm_hw-&gt;slice[slice_num].csr &amp; PWM_CH0_CSR_PH_RET_BITS) {</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno">  420</span>        <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno">  421</span>    }</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span>}</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span> </div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga0da8e86adb7de041a6b8607b36aee442">  433</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga0da8e86adb7de041a6b8607b36aee442">pwm_set_clkdiv_int_frac</a>(uint slice_num, uint8_t integer, uint8_t fract) {</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno">  434</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno">  435</span>    valid_params_if(HARDWARE_PWM, integer &gt;= 1);</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno">  436</span>    valid_params_if(HARDWARE_PWM, fract &lt; 16);</div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno">  437</span>    pwm_hw-&gt;slice[slice_num].div = (((uint)integer) &lt;&lt; PWM_CH0_DIV_INT_LSB) | (((uint)fract) &lt;&lt; PWM_CH0_DIV_FRAC_LSB);</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno">  438</span>}</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno">  439</span> </div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga94782fc53adb07a3594ae0939d9a2e3e">  448</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga94782fc53adb07a3594ae0939d9a2e3e">pwm_set_clkdiv</a>(uint slice_num, <span class="keywordtype">float</span> divider) {</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno">  449</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno">  450</span>    valid_params_if(HARDWARE_PWM, divider &gt;= 1.f &amp;&amp; divider &lt; 256.f);</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno">  451</span>    uint8_t i = (uint8_t)divider;</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno">  452</span>    uint8_t f = (uint8_t)((divider - i) * (0x01 &lt;&lt; 4));</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno">  453</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga0da8e86adb7de041a6b8607b36aee442">pwm_set_clkdiv_int_frac</a>(slice_num, i, f);</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno">  454</span>}</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno">  455</span> </div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gab12ab09d76aed43a36f973232718fdd6">  463</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gab12ab09d76aed43a36f973232718fdd6">pwm_set_output_polarity</a>(uint slice_num, <span class="keywordtype">bool</span> a, <span class="keywordtype">bool</span> b) {</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, bool_to_bit(a) &lt;&lt; PWM_CH0_CSR_A_INV_LSB | bool_to_bit(b) &lt;&lt; PWM_CH0_CSR_B_INV_LSB,</div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span>                     PWM_CH0_CSR_A_INV_BITS | PWM_CH0_CSR_B_INV_BITS);</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno">  467</span>}</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno">  468</span> </div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno">  469</span> </div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga1ee213ebb13b98dc81e60a512f696227">  476</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga1ee213ebb13b98dc81e60a512f696227">pwm_set_clkdiv_mode</a>(uint slice_num, <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pwm.html#ga0a00197703c8606641488cfff3f660e6">pwm_clkdiv_mode</a> mode) {</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno">  478</span>    valid_params_if(HARDWARE_PWM, mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">PWM_DIV_FREE_RUNNING</a> ||</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span>                         mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40">PWM_DIV_B_RISING</a> ||</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno">  480</span>                         mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7">PWM_DIV_B_HIGH</a> ||</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno">  481</span>                         mode == <a class="code hl_enumvalue" href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012">PWM_DIV_B_FALLING</a>);</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno">  482</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, ((uint)mode) &lt;&lt; PWM_CH0_CSR_DIVMODE_LSB, PWM_CH0_CSR_DIVMODE_BITS);</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span>}</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span> </div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gacb2a1995f0bfdb12345607b903c3f11e">  494</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gacb2a1995f0bfdb12345607b903c3f11e">pwm_set_phase_correct</a>(uint slice_num, <span class="keywordtype">bool</span> phase_correct) {</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, bool_to_bit(phase_correct) &lt;&lt; PWM_CH0_CSR_PH_CORRECT_LSB, PWM_CH0_CSR_PH_CORRECT_BITS);</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>}</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span> </div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga216496c331542eb57199018fa86b4408">  525</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga216496c331542eb57199018fa86b4408">pwm_set_enabled</a>(uint slice_num, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;pwm_hw-&gt;slice[slice_num].csr, bool_to_bit(enabled) &lt;&lt; PWM_CH0_CSR_EN_LSB, PWM_CH0_CSR_EN_BITS);</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>}</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span> </div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga257ea7fd33fcf33815a01dd279ca578d">  535</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga257ea7fd33fcf33815a01dd279ca578d">pwm_set_mask_enabled</a>(uint32_t mask) {</div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span>    pwm_hw-&gt;en = mask;</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span>}</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span> </div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno">  555</span><span class="preprocessor">#ifndef PWM_DEFAULT_IRQ_NUM</span></div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno">  556</span><span class="preprocessor">#if PICO_RP2040</span></div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga799affc57db362720ea5f4a5aef381f8">  557</a></span><span class="preprocessor">#define PWM_DEFAULT_IRQ_NUM() PWM_IRQ_WRAP</span></div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno">  558</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno">  559</span><span class="preprocessor">#define PWM_DEFAULT_IRQ_NUM() PWM_IRQ_WRAP_0</span></div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span><span class="comment">// backwards compatibility with RP2040</span></div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span><span class="preprocessor">#define PWM_IRQ_WRAP          PWM_IRQ_WRAP_0</span></div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span><span class="preprocessor">#define isr_pwm_wrap          isr_pwm_wrap_0</span></div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno">  563</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno">  564</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno">  565</span> </div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga093a3c371dda3aa2291331147337265e">  576</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga093a3c371dda3aa2291331147337265e">pwm_set_irq_enabled</a>(uint slice_num, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;inte, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;inte, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span>    }</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span>}</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno">  584</span> </div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga79aa7a5ac3e6960ed1c8eda99cddb1a9">  593</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga79aa7a5ac3e6960ed1c8eda99cddb1a9">pwm_set_irq0_enabled</a>(uint slice_num, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno">  594</span>    <span class="comment">// irq0 always corresponds to the default IRQ</span></div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno">  595</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga093a3c371dda3aa2291331147337265e">pwm_set_irq_enabled</a>(slice_num, enabled);</div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno">  596</span>}</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno">  597</span> </div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span><span class="preprocessor">#if NUM_PWM_IRQS &gt; 1</span></div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pwm_set_irq1_enabled(uint slice_num, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno">  610</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;inte1, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00611" name="l00611"></a><span class="lineno">  611</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00612" name="l00612"></a><span class="lineno">  612</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;inte1, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00613" name="l00613"></a><span class="lineno">  613</span>    }</div>
<div class="line"><a id="l00614" name="l00614"></a><span class="lineno">  614</span>}</div>
<div class="line"><a id="l00615" name="l00615"></a><span class="lineno">  615</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00616" name="l00616"></a><span class="lineno">  616</span> </div>
<div class="line"><a id="l00628" name="l00628"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga2ea24b74474d2a7095ab1a9e409fa85e">  628</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga2ea24b74474d2a7095ab1a9e409fa85e">pwm_irqn_set_slice_enabled</a>(uint irq_index, uint slice_num, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00629" name="l00629"></a><span class="lineno">  629</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00630" name="l00630"></a><span class="lineno">  630</span>    invalid_params_if(HARDWARE_PWM, irq_index &gt;= NUM_PWM_IRQS);</div>
<div class="line"><a id="l00631" name="l00631"></a><span class="lineno">  631</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00632" name="l00632"></a><span class="lineno">  632</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00633" name="l00633"></a><span class="lineno">  633</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00634" name="l00634"></a><span class="lineno">  634</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00635" name="l00635"></a><span class="lineno">  635</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, 1u &lt;&lt; slice_num);</div>
<div class="line"><a id="l00636" name="l00636"></a><span class="lineno">  636</span>    }</div>
<div class="line"><a id="l00637" name="l00637"></a><span class="lineno">  637</span>}</div>
<div class="line"><a id="l00638" name="l00638"></a><span class="lineno">  638</span> </div>
<div class="line"><a id="l00649" name="l00649"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gac32a9b468ddbd49bad6ebff6789fd215">  649</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gac32a9b468ddbd49bad6ebff6789fd215">pwm_set_irq_mask_enabled</a>(uint32_t slice_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00650" name="l00650"></a><span class="lineno">  650</span>    valid_params_if(HARDWARE_PWM, slice_mask &lt; 256);</div>
<div class="line"><a id="l00651" name="l00651"></a><span class="lineno">  651</span><span class="preprocessor">#if PICO_RP2040</span></div>
<div class="line"><a id="l00652" name="l00652"></a><span class="lineno">  652</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00653" name="l00653"></a><span class="lineno">  653</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;inte, slice_mask);</div>
<div class="line"><a id="l00654" name="l00654"></a><span class="lineno">  654</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00655" name="l00655"></a><span class="lineno">  655</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;inte, slice_mask);</div>
<div class="line"><a id="l00656" name="l00656"></a><span class="lineno">  656</span>    }</div>
<div class="line"><a id="l00657" name="l00657"></a><span class="lineno">  657</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00658" name="l00658"></a><span class="lineno">  658</span>    <span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a9b21deae090eb8ab1c69eaa4dd71572f">PWM_IRQ_WRAP_1</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8ab95e3cb2a0db0f078b2f51d43d6f0221">PWM_IRQ_WRAP_0</a> + 1);</div>
<div class="line"><a id="l00659" name="l00659"></a><span class="lineno">  659</span>    uint irq_index = <a class="code hl_define" href="group__hardware__pwm.html#ga799affc57db362720ea5f4a5aef381f8">PWM_DEFAULT_IRQ_NUM</a>() - <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8ab95e3cb2a0db0f078b2f51d43d6f0221">PWM_IRQ_WRAP_0</a>;</div>
<div class="line"><a id="l00660" name="l00660"></a><span class="lineno">  660</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00661" name="l00661"></a><span class="lineno">  661</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, slice_mask);</div>
<div class="line"><a id="l00662" name="l00662"></a><span class="lineno">  662</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00663" name="l00663"></a><span class="lineno">  663</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, slice_mask);</div>
<div class="line"><a id="l00664" name="l00664"></a><span class="lineno">  664</span>    }</div>
<div class="line"><a id="l00665" name="l00665"></a><span class="lineno">  665</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00666" name="l00666"></a><span class="lineno">  666</span>}</div>
<div class="line"><a id="l00667" name="l00667"></a><span class="lineno">  667</span> </div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gade21c4c94d2dce96bb4992d818909f0e">  676</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#gade21c4c94d2dce96bb4992d818909f0e">pwm_set_irq0_mask_enabled</a>(uint32_t slice_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00677" name="l00677"></a><span class="lineno">  677</span>    <span class="comment">// default irq is irq0</span></div>
<div class="line"><a id="l00678" name="l00678"></a><span class="lineno">  678</span>    <a class="code hl_function" href="group__hardware__pwm.html#gac32a9b468ddbd49bad6ebff6789fd215">pwm_set_irq_mask_enabled</a>(slice_mask, enabled);</div>
<div class="line"><a id="l00679" name="l00679"></a><span class="lineno">  679</span>}</div>
<div class="line"><a id="l00680" name="l00680"></a><span class="lineno">  680</span> </div>
<div class="line"><a id="l00681" name="l00681"></a><span class="lineno">  681</span><span class="preprocessor">#if NUM_PWM_IRQS &gt; 1</span></div>
<div class="line"><a id="l00690" name="l00690"></a><span class="lineno">  690</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pwm_set_irq1_mask_enabled(uint32_t slice_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00691" name="l00691"></a><span class="lineno">  691</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00692" name="l00692"></a><span class="lineno">  692</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;inte1, slice_mask);</div>
<div class="line"><a id="l00693" name="l00693"></a><span class="lineno">  693</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00694" name="l00694"></a><span class="lineno">  694</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;inte1, slice_mask);</div>
<div class="line"><a id="l00695" name="l00695"></a><span class="lineno">  695</span>    }</div>
<div class="line"><a id="l00696" name="l00696"></a><span class="lineno">  696</span>}</div>
<div class="line"><a id="l00697" name="l00697"></a><span class="lineno">  697</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00698" name="l00698"></a><span class="lineno">  698</span> </div>
<div class="line"><a id="l00710" name="l00710"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga6c5a284b10961cd0f73e22684df691f0">  710</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga6c5a284b10961cd0f73e22684df691f0">pwm_irqn_set_slice_mask_enabled</a>(uint irq_index, uint slice_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00711" name="l00711"></a><span class="lineno">  711</span>    invalid_params_if(HARDWARE_PWM, irq_index &gt;= NUM_PWM_IRQS);</div>
<div class="line"><a id="l00712" name="l00712"></a><span class="lineno">  712</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l00713" name="l00713"></a><span class="lineno">  713</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, slice_mask);</div>
<div class="line"><a id="l00714" name="l00714"></a><span class="lineno">  714</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00715" name="l00715"></a><span class="lineno">  715</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pwm_hw-&gt;irq_ctrl[irq_index].inte, slice_mask);</div>
<div class="line"><a id="l00716" name="l00716"></a><span class="lineno">  716</span>    }</div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno">  717</span>}</div>
<div class="line"><a id="l00718" name="l00718"></a><span class="lineno">  718</span> </div>
<div class="line"><a id="l00724" name="l00724"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga8d4482b5e125e30bc166d3ed33d8ba2d">  724</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga8d4482b5e125e30bc166d3ed33d8ba2d">pwm_clear_irq</a>(uint slice_num) {</div>
<div class="line"><a id="l00725" name="l00725"></a><span class="lineno">  725</span>    pwm_hw-&gt;intr = 1u &lt;&lt; slice_num;</div>
<div class="line"><a id="l00726" name="l00726"></a><span class="lineno">  726</span>}</div>
<div class="line"><a id="l00727" name="l00727"></a><span class="lineno">  727</span> </div>
<div class="line"><a id="l00733" name="l00733"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga565a6b6d19b60b10f5a91b11152cc8c2">  733</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__pwm.html#ga565a6b6d19b60b10f5a91b11152cc8c2">pwm_get_irq_status_mask</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00734" name="l00734"></a><span class="lineno">  734</span>    <span class="keywordflow">return</span> pwm_hw-&gt;ints;</div>
<div class="line"><a id="l00735" name="l00735"></a><span class="lineno">  735</span>}</div>
<div class="line"><a id="l00736" name="l00736"></a><span class="lineno">  736</span> </div>
<div class="line"><a id="l00742" name="l00742"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga1c21d122b5605a374644b07d6c7205e6">  742</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__pwm.html#ga1c21d122b5605a374644b07d6c7205e6">pwm_get_irq0_status_mask</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00743" name="l00743"></a><span class="lineno">  743</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__pwm.html#ga565a6b6d19b60b10f5a91b11152cc8c2">pwm_get_irq_status_mask</a>();</div>
<div class="line"><a id="l00744" name="l00744"></a><span class="lineno">  744</span>}</div>
<div class="line"><a id="l00745" name="l00745"></a><span class="lineno">  745</span> </div>
<div class="line"><a id="l00746" name="l00746"></a><span class="lineno">  746</span><span class="preprocessor">#if NUM_PWM_IRQS &gt; 1</span></div>
<div class="line"><a id="l00752" name="l00752"></a><span class="lineno">  752</span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t pwm_get_irq1_status_mask(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00753" name="l00753"></a><span class="lineno">  753</span>    <span class="keywordflow">return</span> pwm_hw-&gt;ints1;</div>
<div class="line"><a id="l00754" name="l00754"></a><span class="lineno">  754</span>}</div>
<div class="line"><a id="l00755" name="l00755"></a><span class="lineno">  755</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00756" name="l00756"></a><span class="lineno">  756</span> </div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#gab23895c8c5a1d73d73e4f1f32e4d255e">  763</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__pwm.html#gab23895c8c5a1d73d73e4f1f32e4d255e">pwm_irqn_get_status_mask</a>(uint irq_index) {</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span>    invalid_params_if(HARDWARE_PWM, irq_index &gt;= NUM_DMA_IRQS);</div>
<div class="line"><a id="l00765" name="l00765"></a><span class="lineno">  765</span>    <span class="keywordflow">return</span> pwm_hw-&gt;irq_ctrl[irq_index].ints;</div>
<div class="line"><a id="l00766" name="l00766"></a><span class="lineno">  766</span>}</div>
<div class="line"><a id="l00767" name="l00767"></a><span class="lineno">  767</span> </div>
<div class="line"><a id="l00773" name="l00773"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga457ee599e471a8da59c42f5c26710ff6">  773</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga457ee599e471a8da59c42f5c26710ff6">pwm_force_irq</a>(uint slice_num) {</div>
<div class="line"><a id="l00774" name="l00774"></a><span class="lineno">  774</span>    pwm_hw-&gt;intf = 1u &lt;&lt; slice_num;</div>
<div class="line"><a id="l00775" name="l00775"></a><span class="lineno">  775</span>}</div>
<div class="line"><a id="l00776" name="l00776"></a><span class="lineno">  776</span> </div>
<div class="line"><a id="l00782" name="l00782"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga5630f7a5331a0b118ce0a288897b75cc">  782</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga5630f7a5331a0b118ce0a288897b75cc">pwm_force_irq0</a>(uint slice_num) {</div>
<div class="line"><a id="l00783" name="l00783"></a><span class="lineno">  783</span>    <a class="code hl_function" href="group__hardware__pwm.html#ga457ee599e471a8da59c42f5c26710ff6">pwm_force_irq</a>(slice_num);</div>
<div class="line"><a id="l00784" name="l00784"></a><span class="lineno">  784</span>}</div>
<div class="line"><a id="l00785" name="l00785"></a><span class="lineno">  785</span> </div>
<div class="line"><a id="l00786" name="l00786"></a><span class="lineno">  786</span><span class="preprocessor">#if NUM_PWM_IRQS &gt; 1</span></div>
<div class="line"><a id="l00792" name="l00792"></a><span class="lineno">  792</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pwm_force_irq1(uint slice_num) {</div>
<div class="line"><a id="l00793" name="l00793"></a><span class="lineno">  793</span>    pwm_hw-&gt;intf1 = 1u &lt;&lt; slice_num;</div>
<div class="line"><a id="l00794" name="l00794"></a><span class="lineno">  794</span>}</div>
<div class="line"><a id="l00795" name="l00795"></a><span class="lineno">  795</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00796" name="l00796"></a><span class="lineno">  796</span> </div>
<div class="line"><a id="l00803" name="l00803"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga4ddb2ef5ee40a1f59d35b0f4966fced1">  803</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pwm.html#ga4ddb2ef5ee40a1f59d35b0f4966fced1">pwm_irqn_force</a>(uint irq_index, uint slice_num) {</div>
<div class="line"><a id="l00804" name="l00804"></a><span class="lineno">  804</span>    invalid_params_if(HARDWARE_PWM, irq_index &gt;= NUM_PWM_IRQS);</div>
<div class="line"><a id="l00805" name="l00805"></a><span class="lineno">  805</span>    pwm_hw-&gt;irq_ctrl[irq_index].intf = 1u &lt;&lt; slice_num;</div>
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno">  806</span>}</div>
<div class="line"><a id="l00807" name="l00807"></a><span class="lineno">  807</span> </div>
<div class="line"><a id="l00813" name="l00813"></a><span class="lineno"><a class="line" href="group__hardware__pwm.html#ga2f600a7192ecd69a8680be367e8d0a00">  813</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pwm.html#ga2f600a7192ecd69a8680be367e8d0a00">pwm_get_dreq</a>(uint slice_num) {</div>
<div class="line"><a id="l00814" name="l00814"></a><span class="lineno">  814</span>    check_slice_num_param(slice_num);</div>
<div class="line"><a id="l00815" name="l00815"></a><span class="lineno">  815</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pwm.html#gab346f319fab9342c66d48bdcc9bb7430">PWM_DREQ_NUM</a>(slice_num);</div>
<div class="line"><a id="l00816" name="l00816"></a><span class="lineno">  816</span>}</div>
<div class="line"><a id="l00817" name="l00817"></a><span class="lineno">  817</span> </div>
<div class="line"><a id="l00818" name="l00818"></a><span class="lineno">  818</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00819" name="l00819"></a><span class="lineno">  819</span>}</div>
<div class="line"><a id="l00820" name="l00820"></a><span class="lineno">  820</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00821" name="l00821"></a><span class="lineno">  821</span> </div>
<div class="line"><a id="l00822" name="l00822"></a><span class="lineno">  822</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__base_html_ga625e737a57f12211cf1f634ca5095ae4"><div class="ttname"><a href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a></div><div class="ttdeci">static __force_inline void hw_set_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically set the specified bits to 1 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:135</div></div>
<div class="ttc" id="agroup__hardware__base_html_ga81b27e30abef56fe090d22fd8dfdbcc1"><div class="ttname"><a href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a></div><div class="ttdeci">static __force_inline void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask)</div><div class="ttdoc">Set new values for a sub-set of the bits in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:171</div></div>
<div class="ttc" id="agroup__hardware__base_html_gafd1c089df868d987daf95870b501c2ed"><div class="ttname"><a href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a></div><div class="ttdeci">static __force_inline void hw_clear_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically clear the specified bits to 0 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:145</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a1504bdb2bd8aaa535903ea11aa2c2994"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a1504bdb2bd8aaa535903ea11aa2c2994">DREQ_PWM_WRAP1</a></div><div class="ttdeci">@ DREQ_PWM_WRAP1</div><div class="ttdoc">Select PWM Counter 1's Wrap Value as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:115</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a2a861c9dcce9e158ace7bc5d547ebde1"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a2a861c9dcce9e158ace7bc5d547ebde1">DREQ_PWM_WRAP0</a></div><div class="ttdeci">@ DREQ_PWM_WRAP0</div><div class="ttdoc">Select PWM Counter 0's Wrap Value as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:114</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014adafe5a7f2f401a496e842c7a2c95dac5"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014adafe5a7f2f401a496e842c7a2c95dac5">DREQ_PWM_WRAP7</a></div><div class="ttdeci">@ DREQ_PWM_WRAP7</div><div class="ttdoc">Select PWM Counter 7's Wrap Value as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:121</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8a9b21deae090eb8ab1c69eaa4dd71572f"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a9b21deae090eb8ab1c69eaa4dd71572f">PWM_IRQ_WRAP_1</a></div><div class="ttdeci">@ PWM_IRQ_WRAP_1</div><div class="ttdoc">Select PWM's IRQ_WRAP 1 output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:83</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8ab95e3cb2a0db0f078b2f51d43d6f0221"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8ab95e3cb2a0db0f078b2f51d43d6f0221">PWM_IRQ_WRAP_0</a></div><div class="ttdeci">@ PWM_IRQ_WRAP_0</div><div class="ttdoc">Select PWM's IRQ_WRAP 0 output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:82</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga01d3e90bb7aa9a8b6884eddbfbebc175"><div class="ttname"><a href="group__hardware__pwm.html#ga01d3e90bb7aa9a8b6884eddbfbebc175">pwm_init</a></div><div class="ttdeci">static void pwm_init(uint slice_num, pwm_config *c, bool start)</div><div class="ttdoc">Initialise a PWM with settings from a configuration object.</div><div class="ttdef"><b>Definition:</b> pwm.h:247</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga031fe8a502c9640ed4f5fab74d6248ae"><div class="ttname"><a href="group__hardware__pwm.html#ga031fe8a502c9640ed4f5fab74d6248ae">pwm_config_set_phase_correct</a></div><div class="ttdeci">static void pwm_config_set_phase_correct(pwm_config *c, bool phase_correct)</div><div class="ttdoc">Set phase correction in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:141</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga093a3c371dda3aa2291331147337265e"><div class="ttname"><a href="group__hardware__pwm.html#ga093a3c371dda3aa2291331147337265e">pwm_set_irq_enabled</a></div><div class="ttdeci">static void pwm_set_irq_enabled(uint slice_num, bool enabled)</div><div class="ttdoc">Enable PWM instance interrupt via the default PWM IRQ (PWM_IRQ_WRAP_0 on RP2350)</div><div class="ttdef"><b>Definition:</b> pwm.h:576</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga0a00197703c8606641488cfff3f660e6"><div class="ttname"><a href="group__hardware__pwm.html#ga0a00197703c8606641488cfff3f660e6">pwm_clkdiv_mode</a></div><div class="ttdeci">pwm_clkdiv_mode</div><div class="ttdoc">PWM Divider mode settings.</div><div class="ttdef"><b>Definition:</b> pwm.h:55</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga0da8e86adb7de041a6b8607b36aee442"><div class="ttname"><a href="group__hardware__pwm.html#ga0da8e86adb7de041a6b8607b36aee442">pwm_set_clkdiv_int_frac</a></div><div class="ttdeci">static void pwm_set_clkdiv_int_frac(uint slice_num, uint8_t integer, uint8_t fract)</div><div class="ttdoc">Set PWM clock divider using an 8:4 fractional value.</div><div class="ttdef"><b>Definition:</b> pwm.h:433</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga0dec65009d8c0738677818b680fd2ad9"><div class="ttname"><a href="group__hardware__pwm.html#ga0dec65009d8c0738677818b680fd2ad9">pwm_retard_count</a></div><div class="ttdeci">static void pwm_retard_count(uint slice_num)</div><div class="ttdoc">Retard PWM count.</div><div class="ttdef"><b>Definition:</b> pwm.h:416</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga157c8b11483967714823187725a5ed5a"><div class="ttname"><a href="group__hardware__pwm.html#ga157c8b11483967714823187725a5ed5a">pwm_get_counter</a></div><div class="ttdeci">static uint16_t pwm_get_counter(uint slice_num)</div><div class="ttdoc">Get PWM counter.</div><div class="ttdef"><b>Definition:</b> pwm.h:371</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga18a2b3bbc240d1a9b36526d69c06ec3d"><div class="ttname"><a href="group__hardware__pwm.html#ga18a2b3bbc240d1a9b36526d69c06ec3d">pwm_set_chan_level</a></div><div class="ttdeci">static void pwm_set_chan_level(uint slice_num, uint chan, uint16_t level)</div><div class="ttdoc">Set the current PWM counter compare value for one channel.</div><div class="ttdef"><b>Definition:</b> pwm.h:311</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga1c21d122b5605a374644b07d6c7205e6"><div class="ttname"><a href="group__hardware__pwm.html#ga1c21d122b5605a374644b07d6c7205e6">pwm_get_irq0_status_mask</a></div><div class="ttdeci">static uint32_t pwm_get_irq0_status_mask(void)</div><div class="ttdoc">Get PWM interrupt status, raw for the PWM_IRQ_WRAP_0.</div><div class="ttdef"><b>Definition:</b> pwm.h:742</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga1d60d45df884a7abbde52e326586d55a"><div class="ttname"><a href="group__hardware__pwm.html#ga1d60d45df884a7abbde52e326586d55a">pwm_config_set_clkdiv_int</a></div><div class="ttdeci">static void pwm_config_set_clkdiv_int(pwm_config *c, uint div)</div><div class="ttdoc">Set PWM clock divider in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:188</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga1ee213ebb13b98dc81e60a512f696227"><div class="ttname"><a href="group__hardware__pwm.html#ga1ee213ebb13b98dc81e60a512f696227">pwm_set_clkdiv_mode</a></div><div class="ttdeci">static void pwm_set_clkdiv_mode(uint slice_num, enum pwm_clkdiv_mode mode)</div><div class="ttdoc">Set PWM divider mode.</div><div class="ttdef"><b>Definition:</b> pwm.h:476</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga216496c331542eb57199018fa86b4408"><div class="ttname"><a href="group__hardware__pwm.html#ga216496c331542eb57199018fa86b4408">pwm_set_enabled</a></div><div class="ttdeci">static void pwm_set_enabled(uint slice_num, bool enabled)</div><div class="ttdoc">Enable/Disable PWM.</div><div class="ttdef"><b>Definition:</b> pwm.h:525</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga257ea7fd33fcf33815a01dd279ca578d"><div class="ttname"><a href="group__hardware__pwm.html#ga257ea7fd33fcf33815a01dd279ca578d">pwm_set_mask_enabled</a></div><div class="ttdeci">static void pwm_set_mask_enabled(uint32_t mask)</div><div class="ttdoc">Enable/Disable multiple PWM slices simultaneously.</div><div class="ttdef"><b>Definition:</b> pwm.h:535</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga279d1ba7dcc8f19619f389317efb41fd"><div class="ttname"><a href="group__hardware__pwm.html#ga279d1ba7dcc8f19619f389317efb41fd">pwm_set_gpio_level</a></div><div class="ttdeci">static void pwm_set_gpio_level(uint gpio, uint16_t level)</div><div class="ttdoc">Helper function to set the PWM level for the slice and channel associated with a GPIO.</div><div class="ttdef"><b>Definition:</b> pwm.h:358</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga27a86a921b2ad2ebd811db1255d34d06"><div class="ttname"><a href="group__hardware__pwm.html#ga27a86a921b2ad2ebd811db1255d34d06">pwm_config_set_clkdiv_mode</a></div><div class="ttdeci">static void pwm_config_set_clkdiv_mode(pwm_config *c, enum pwm_clkdiv_mode mode)</div><div class="ttdoc">Set PWM counting mode in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:203</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga2ea24b74474d2a7095ab1a9e409fa85e"><div class="ttname"><a href="group__hardware__pwm.html#ga2ea24b74474d2a7095ab1a9e409fa85e">pwm_irqn_set_slice_enabled</a></div><div class="ttdeci">static void pwm_irqn_set_slice_enabled(uint irq_index, uint slice_num, bool enabled)</div><div class="ttdoc">Enable PWM instance interrupt via either PWM_IRQ_WRAP_0 or PWM_IRQ_WRAP_1.</div><div class="ttdef"><b>Definition:</b> pwm.h:628</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga2f600a7192ecd69a8680be367e8d0a00"><div class="ttname"><a href="group__hardware__pwm.html#ga2f600a7192ecd69a8680be367e8d0a00">pwm_get_dreq</a></div><div class="ttdeci">static uint pwm_get_dreq(uint slice_num)</div><div class="ttdoc">Return the DREQ to use for pacing transfers to a particular PWM slice.</div><div class="ttdef"><b>Definition:</b> pwm.h:813</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga3b0d7a6e493b4dc9ded8f53fb9be474c"><div class="ttname"><a href="group__hardware__pwm.html#ga3b0d7a6e493b4dc9ded8f53fb9be474c">pwm_config_set_clkdiv_int_frac</a></div><div class="ttdeci">static void pwm_config_set_clkdiv_int_frac(pwm_config *c, uint8_t integer, uint8_t fract)</div><div class="ttdoc">Set PWM clock divider in a PWM configuration using an 8:4 fractional value.</div><div class="ttdef"><b>Definition:</b> pwm.h:172</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga457ee599e471a8da59c42f5c26710ff6"><div class="ttname"><a href="group__hardware__pwm.html#ga457ee599e471a8da59c42f5c26710ff6">pwm_force_irq</a></div><div class="ttdeci">static void pwm_force_irq(uint slice_num)</div><div class="ttdoc">Force PWM interrupt for the default PWM IRQ (PWM_IRQ_WRAP_0 on RP2350)</div><div class="ttdef"><b>Definition:</b> pwm.h:773</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga4ddb2ef5ee40a1f59d35b0f4966fced1"><div class="ttname"><a href="group__hardware__pwm.html#ga4ddb2ef5ee40a1f59d35b0f4966fced1">pwm_irqn_force</a></div><div class="ttdeci">static void pwm_irqn_force(uint irq_index, uint slice_num)</div><div class="ttdoc">Force PWM interrupt via PWM_IRQ_WRAP_0 or PWM_IRQ_WRAP_1.</div><div class="ttdef"><b>Definition:</b> pwm.h:803</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga5179ec971146ab611b9232587e945769"><div class="ttname"><a href="group__hardware__pwm.html#ga5179ec971146ab611b9232587e945769">pwm_set_counter</a></div><div class="ttdeci">static void pwm_set_counter(uint slice_num, uint16_t c)</div><div class="ttdoc">Set PWM counter.</div><div class="ttdef"><b>Definition:</b> pwm.h:385</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga5630f7a5331a0b118ce0a288897b75cc"><div class="ttname"><a href="group__hardware__pwm.html#ga5630f7a5331a0b118ce0a288897b75cc">pwm_force_irq0</a></div><div class="ttdeci">static void pwm_force_irq0(uint slice_num)</div><div class="ttdoc">Force PWM interrupt via PWM_IRQ_WRAP_0.</div><div class="ttdef"><b>Definition:</b> pwm.h:782</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga565a6b6d19b60b10f5a91b11152cc8c2"><div class="ttname"><a href="group__hardware__pwm.html#ga565a6b6d19b60b10f5a91b11152cc8c2">pwm_get_irq_status_mask</a></div><div class="ttdeci">static uint32_t pwm_get_irq_status_mask(void)</div><div class="ttdoc">Get PWM interrupt status, raw for the default PWM IRQ (PWM_IRQ_WRAP_0 on RP2350)</div><div class="ttdef"><b>Definition:</b> pwm.h:733</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga679802450ac829eff368e8f109df387e"><div class="ttname"><a href="group__hardware__pwm.html#ga679802450ac829eff368e8f109df387e">pwm_config_set_clkdiv</a></div><div class="ttdeci">static void pwm_config_set_clkdiv(pwm_config *c, float div)</div><div class="ttdoc">Set PWM clock divider in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:156</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga6c5a284b10961cd0f73e22684df691f0"><div class="ttname"><a href="group__hardware__pwm.html#ga6c5a284b10961cd0f73e22684df691f0">pwm_irqn_set_slice_mask_enabled</a></div><div class="ttdeci">static void pwm_irqn_set_slice_mask_enabled(uint irq_index, uint slice_mask, bool enabled)</div><div class="ttdoc">Enable PWM instance interrupts via either PWM_IRQ_WRAP_0 or PWM_IRQ_WRAP_1.</div><div class="ttdef"><b>Definition:</b> pwm.h:710</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga6f8fe346e6912cfab3d36b00043a3627"><div class="ttname"><a href="group__hardware__pwm.html#ga6f8fe346e6912cfab3d36b00043a3627">pwm_set_wrap</a></div><div class="ttdeci">static void pwm_set_wrap(uint slice_num, uint16_t wrap)</div><div class="ttdoc">Set the current PWM counter wrap value.</div><div class="ttdef"><b>Definition:</b> pwm.h:291</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga799affc57db362720ea5f4a5aef381f8"><div class="ttname"><a href="group__hardware__pwm.html#ga799affc57db362720ea5f4a5aef381f8">PWM_DEFAULT_IRQ_NUM</a></div><div class="ttdeci">#define PWM_DEFAULT_IRQ_NUM()</div><div class="ttdoc">Returns the irq_num_t for the default PWM IRQ.</div><div class="ttdef"><b>Definition:</b> pwm.h:557</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga79aa7a5ac3e6960ed1c8eda99cddb1a9"><div class="ttname"><a href="group__hardware__pwm.html#ga79aa7a5ac3e6960ed1c8eda99cddb1a9">pwm_set_irq0_enabled</a></div><div class="ttdeci">static void pwm_set_irq0_enabled(uint slice_num, bool enabled)</div><div class="ttdoc">Enable PWM instance interrupt via PWM_IRQ_WRAP_0.</div><div class="ttdef"><b>Definition:</b> pwm.h:593</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga8b2117d67a544f64c001f4f32c723eef"><div class="ttname"><a href="group__hardware__pwm.html#ga8b2117d67a544f64c001f4f32c723eef">pwm_gpio_to_slice_num</a></div><div class="ttdeci">static uint pwm_gpio_to_slice_num(uint gpio)</div><div class="ttdoc">Determine the PWM slice that is attached to the specified GPIO.</div><div class="ttdef"><b>Definition:</b> pwm.h:115</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga8d4482b5e125e30bc166d3ed33d8ba2d"><div class="ttname"><a href="group__hardware__pwm.html#ga8d4482b5e125e30bc166d3ed33d8ba2d">pwm_clear_irq</a></div><div class="ttdeci">static void pwm_clear_irq(uint slice_num)</div><div class="ttdoc">Clear a single PWM channel interrupt.</div><div class="ttdef"><b>Definition:</b> pwm.h:724</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga94782fc53adb07a3594ae0939d9a2e3e"><div class="ttname"><a href="group__hardware__pwm.html#ga94782fc53adb07a3594ae0939d9a2e3e">pwm_set_clkdiv</a></div><div class="ttdeci">static void pwm_set_clkdiv(uint slice_num, float divider)</div><div class="ttdoc">Set PWM clock divider.</div><div class="ttdef"><b>Definition:</b> pwm.h:448</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga96ba504fe00cb8e0d88f0730cdfdaafc"><div class="ttname"><a href="group__hardware__pwm.html#ga96ba504fe00cb8e0d88f0730cdfdaafc">pwm_gpio_to_channel</a></div><div class="ttdeci">static uint pwm_gpio_to_channel(uint gpio)</div><div class="ttdoc">Determine the PWM channel that is attached to the specified GPIO.</div><div class="ttdef"><b>Definition:</b> pwm.h:127</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_ga98a47b25fcc2f28addf0a28ee3234efd"><div class="ttname"><a href="group__hardware__pwm.html#ga98a47b25fcc2f28addf0a28ee3234efd">pwm_advance_count</a></div><div class="ttdeci">static void pwm_advance_count(uint slice_num)</div><div class="ttdoc">Advance PWM count.</div><div class="ttdef"><b>Definition:</b> pwm.h:399</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gab12ab09d76aed43a36f973232718fdd6"><div class="ttname"><a href="group__hardware__pwm.html#gab12ab09d76aed43a36f973232718fdd6">pwm_set_output_polarity</a></div><div class="ttdeci">static void pwm_set_output_polarity(uint slice_num, bool a, bool b)</div><div class="ttdoc">Set PWM output polarity.</div><div class="ttdef"><b>Definition:</b> pwm.h:463</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gab23895c8c5a1d73d73e4f1f32e4d255e"><div class="ttname"><a href="group__hardware__pwm.html#gab23895c8c5a1d73d73e4f1f32e4d255e">pwm_irqn_get_status_mask</a></div><div class="ttdeci">static uint32_t pwm_irqn_get_status_mask(uint irq_index)</div><div class="ttdoc">Get PWM interrupt status, raw for either PWM_IRQ_WRAP_0 or PWM_IRQ_WRAP_1.</div><div class="ttdef"><b>Definition:</b> pwm.h:763</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gab346f319fab9342c66d48bdcc9bb7430"><div class="ttname"><a href="group__hardware__pwm.html#gab346f319fab9342c66d48bdcc9bb7430">PWM_DREQ_NUM</a></div><div class="ttdeci">#define PWM_DREQ_NUM(slice_num)</div><div class="ttdoc">Returns the dreq_num_t used for pacing DMA transfers for a given PWM slice.</div><div class="ttdef"><b>Definition:</b> pwm.h:85</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gab459185e217d5e215dae3cfb3d6de1b5"><div class="ttname"><a href="group__hardware__pwm.html#gab459185e217d5e215dae3cfb3d6de1b5">pwm_config_set_output_polarity</a></div><div class="ttdeci">static void pwm_config_set_output_polarity(pwm_config *c, bool a, bool b)</div><div class="ttdoc">Set output polarity in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:219</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gac32a9b468ddbd49bad6ebff6789fd215"><div class="ttname"><a href="group__hardware__pwm.html#gac32a9b468ddbd49bad6ebff6789fd215">pwm_set_irq_mask_enabled</a></div><div class="ttdeci">static void pwm_set_irq_mask_enabled(uint32_t slice_mask, bool enabled)</div><div class="ttdoc">Enable multiple PWM instance interrupts via the default PWM IRQ (PWM_IRQ_WRAP_0 on RP2350)</div><div class="ttdef"><b>Definition:</b> pwm.h:649</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gacb2a1995f0bfdb12345607b903c3f11e"><div class="ttname"><a href="group__hardware__pwm.html#gacb2a1995f0bfdb12345607b903c3f11e">pwm_set_phase_correct</a></div><div class="ttdeci">static void pwm_set_phase_correct(uint slice_num, bool phase_correct)</div><div class="ttdoc">Set PWM phase correct on/off.</div><div class="ttdef"><b>Definition:</b> pwm.h:494</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gad6cf6d9237144234732a50eb6d5e4fe9"><div class="ttname"><a href="group__hardware__pwm.html#gad6cf6d9237144234732a50eb6d5e4fe9">pwm_config_set_wrap</a></div><div class="ttdeci">static void pwm_config_set_wrap(pwm_config *c, uint16_t wrap)</div><div class="ttdoc">Set PWM counter wrap value in a PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:232</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gad76f94a6dd6133c52284b6be8ae98e16"><div class="ttname"><a href="group__hardware__pwm.html#gad76f94a6dd6133c52284b6be8ae98e16">pwm_get_default_config</a></div><div class="ttdeci">static pwm_config pwm_get_default_config(void)</div><div class="ttdoc">Get a set of default values for PWM configuration.</div><div class="ttdef"><b>Definition:</b> pwm.h:266</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gad7c4554b59132ddd4a9773cca4a27203"><div class="ttname"><a href="group__hardware__pwm.html#gad7c4554b59132ddd4a9773cca4a27203">PWM_GPIO_SLICE_NUM</a></div><div class="ttdeci">#define PWM_GPIO_SLICE_NUM(gpio)</div><div class="ttdoc">Returns the PWM slice number for a given GPIO number.</div><div class="ttdef"><b>Definition:</b> pwm.h:95</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gade21c4c94d2dce96bb4992d818909f0e"><div class="ttname"><a href="group__hardware__pwm.html#gade21c4c94d2dce96bb4992d818909f0e">pwm_set_irq0_mask_enabled</a></div><div class="ttdeci">static void pwm_set_irq0_mask_enabled(uint32_t slice_mask, bool enabled)</div><div class="ttdoc">Enable multiple PWM instance interrupts via PWM_IRQ_WRAP_0.</div><div class="ttdef"><b>Definition:</b> pwm.h:676</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gae7064c88717eee935e50138f5b0ae2b7"><div class="ttname"><a href="group__hardware__pwm.html#gae7064c88717eee935e50138f5b0ae2b7">pwm_set_both_levels</a></div><div class="ttdeci">static void pwm_set_both_levels(uint slice_num, uint16_t level_a, uint16_t level_b)</div><div class="ttdoc">Set PWM counter compare values.</div><div class="ttdef"><b>Definition:</b> pwm.h:335</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012"><div class="ttname"><a href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a0b4afcaa75090169d3b7cbec4c0e2012">PWM_DIV_B_FALLING</a></div><div class="ttdeci">@ PWM_DIV_B_FALLING</div><div class="ttdoc">Fractional divider advances with each falling edge of the PWM B pin.</div><div class="ttdef"><b>Definition:</b> pwm.h:59</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7"><div class="ttname"><a href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6a186c27a4768fcb0c6930471db51861b7">PWM_DIV_B_HIGH</a></div><div class="ttdeci">@ PWM_DIV_B_HIGH</div><div class="ttdoc">Fractional divider is gated by the PWM B pin.</div><div class="ttdef"><b>Definition:</b> pwm.h:57</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b"><div class="ttname"><a href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6acd3efbc3feaca58b87930008fdd8486b">PWM_DIV_FREE_RUNNING</a></div><div class="ttdeci">@ PWM_DIV_FREE_RUNNING</div><div class="ttdoc">Free-running counting at rate dictated by fractional divider.</div><div class="ttdef"><b>Definition:</b> pwm.h:56</div></div>
<div class="ttc" id="agroup__hardware__pwm_html_gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40"><div class="ttname"><a href="group__hardware__pwm.html#gga0a00197703c8606641488cfff3f660e6ad9d2170532c2c9ab4016908544c8ad40">PWM_DIV_B_RISING</a></div><div class="ttdeci">@ PWM_DIV_B_RISING</div><div class="ttdoc">Fractional divider advances with each rising edge of the PWM B pin.</div><div class="ttdef"><b>Definition:</b> pwm.h:58</div></div>
<div class="ttc" id="agroup__pico__platform_html_gab0d1ba75ceb64131e19f613d7a5313c9"><div class="ttname"><a href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a></div><div class="ttdeci">static __force_inline void tight_loop_contents(void)</div><div class="ttdoc">No-op function for the body of tight loops.</div><div class="ttdef"><b>Definition:</b> platform.h:67</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="astructpwm__config_html"><div class="ttname"><a href="structpwm__config.html">pwm_config</a></div><div class="ttdef"><b>Definition:</b> pwm.h:68</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>